package com.wenx.v3system.modular.cloud.domain.dto;

import com.wenx.base.domain.BaseDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.util.List;

/**
 * 系统菜单DTO
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Schema(description = "系统菜单信息")
public class SysMenuDto extends BaseDto {

    @NotBlank(message = "菜单编码不能为空")
    @Size(max = 50, message = "菜单编码长度不能超过50个字符")
    @Schema(description = "菜单编码", example = "USER_MANAGE")
    private String code;

    @NotBlank(message = "菜单名称不能为空")
    @Size(max = 100, message = "菜单名称长度不能超过100个字符")
    @Schema(description = "菜单名称", example = "用户管理")
    private String name;

    @Schema(description = "菜单权限标识", example = "user:view,user:add")
    private String permissions;

    @Schema(description = "父菜单ID", example = "1000")
    private Long parentId;

    @Schema(description = "祖级列表（用逗号分隔）", example = "0,1000")
    private String ancestors;

    @NotNull(message = "菜单类型不能为空")
    @Schema(description = "菜单类型：1-目录，2-菜单，3-按钮", example = "2")
    private Integer type;

    @Schema(description = "菜单图标", example = "user")
    private String icon;

    @Schema(description = "菜单路径", example = "/system/user")
    private String path;

    @Schema(description = "菜单状态：1-启用，0-禁用", example = "1")
    private Integer status;

    @Size(max = 500, message = "菜单描述长度不能超过500个字符")
    @Schema(description = "菜单描述", example = "用户管理菜单")
    private String description;

    @Schema(description = "排序", example = "1")
    private Long sort;

    // 关联关系
    @Schema(description = "子菜单列表")
    private List<SysMenuDto> children;

    @Schema(description = "菜单权限列表")
    private List<SysPermissionDto> permissionList;
}
